package com.example.gradleaop


import org.objectweb.asm.MethodVisitor
import org.objectweb.asm.Opcodes

class DemoMethodVisitor(methodVisitor: MethodVisitor) : MethodVisitor(Opcodes.ASM5, methodVisitor) {

    //插入：Log.e("TAG", "===== This is just a test message =====");
    override fun visitCode() {
        super.visitCode()

        mv.visitLdcInsn("TAG")
        mv.visitLdcInsn("===== This is just a test message cjh=====")
        mv.visitMethodInsn(
            Opcodes.INVOKESTATIC,
            "android/util/Log",
            "e",
            "(Ljava/lang/String;Ljava/lang/String;)I",
            false
        )
        mv.visitInsn(Opcodes.POP)
    }
}
